Default to using libgc alloc instead of system alloc#192
Merged
ltratt merged 3 commits intosoftdevteam:masterfrom Jun 24, 2025
Merged
Default to using libgc alloc instead of system alloc#192ltratt merged 3 commits intosoftdevteam:masterfrom
ltratt merged 3 commits intosoftdevteam:masterfrom
Conversation
9c1469a to
f62d899
Compare
Collaborator
Author
|
This PR is now ready for review again. There were a couple of things I needed to add and it made sense to split it up into separate commits:
If you're happy, I can squash. |
Member
|
Please squash. |
Previously users had to ensure they set the #[global_allocator] in order to use Alloy. This was never ideal, but it was necessary because it was too difficult to implement when we statically linked libgc. We've changed this to use dynamic linkage now, and I also know my way around the bootstrap process, so I've fixed this long standing annoyance. In addition, this is also needed for more precise metric tracking in our benchmarks, where we use different allocators depending whether we're constructing an `Rc` / `Arc` etc. Now, these will always correctly resolve to the libgc allocator.
For platform compatibilty with Windows, Rust disables support for distributing custom toolchains which contain symlinks. However, our custom `libgc`, which is installed in sysroot, might include symlinks to the versioned `libgc.so` SONAME on some platforms. We should allow this because we don't support Windows anyway.
e2bd99e to
9738e1c
Compare
Collaborator
Author
|
Squashed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously users had to ensure they set the
#[global_allocator]in order to use Alloy. This was never ideal, but it was necessary because it was too difficult to implement when we statically linked libgc. We've changed this to use dynamic linkage now, and I also know my way around the bootstrap process, so I've fixed this long standing annoyance.In addition, this is also needed for more precise metric tracking in our benchmarks, where we use different allocators depending whether we're constructing an
Rc/Arcetc. Now, these will always correctly resolve to the libgc allocator.